home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / qbasicpg.zip / DEFSG_EX.BAS < prev    next >
BASIC Source File  |  1988-09-17  |  995b  |  45 lines

  1. ' *** DEFSG_EX.BAS ***
  2. '
  3. DECLARE SUB CapsOn ()
  4. DECLARE SUB CapsOff ()
  5. DECLARE SUB PrntMsg (R%,C%,M$)
  6.  
  7. CLS
  8. CapsOn
  9. PrntMsg 24,1,"<Caps Lock On>"
  10. LOCATE 12,10
  11. LINE INPUT "Enter a string (all characters are caps): ",S$
  12. CapsOff
  13. PrntMsg 24,1,"              "
  14. PrntMsg 25,1,"Press any key to continue..."
  15. DO WHILE INKEY$="" : LOOP
  16. CLS
  17. END
  18.  
  19. SUB CapsOn STATIC
  20. ' Turn Caps Lock on
  21.    ' Set segment to low memory
  22.    DEF SEG = 0
  23.    ' Set Caps Lock on (turn on bit 6 of &H0417)
  24.    POKE &H0417,PEEK(&H0417) OR &H40
  25.    ' Restore segment
  26.    DEF SEG
  27. END SUB
  28.  
  29. SUB CapsOff STATIC
  30. ' Turn Caps Lock off
  31.    DEF SEG=0
  32.    ' Set Caps Lock off (turn off bit 6 of &H0417)
  33.    POKE &H0417,PEEK(&H0417) AND &HBF
  34.    DEF SEG
  35. END SUB
  36.  
  37. SUB PrntMsg (Row%, Col%, Message$) STATIC
  38. ' Print message at Row%, Col% without changing cursor
  39.    ' Save cursor position
  40.    CurRow%=CSRLIN : CurCol%=POS(0)
  41.    LOCATE Row%,Col% : PRINT Message$;
  42.    ' Restore cursor
  43.    LOCATE CurRow%,CurCol%
  44. END SUB
  45.